function Calculation(firstItem,secondItem){
	this.lockFirst=false;
	this.lockSecond=false;
	this.first=new It().bind(firstItem);	
	this.first.calculation=this;
	this.first.afterChange=function(){
		if(this.calculation.lockFirst)return;
		this.calculation.lockFirst=true;		
		if(!this.calculation.lockSecond)this.calculation.second.value(this.calculation.calculateSecond());
		this.calculation.lockFirst=false;
		};	
	this.second=new It().bind(secondItem);
	this.second.calculation=this;		
	this.second.afterChange=function(){
		if(this.calculation.lockSecond)return;
		this.calculation.lockSecond=true;		
		if(!this.calculation.lockFirst)this.calculation.first.value(this.calculation.calculateFirst());
		this.calculation.lockSecond=false;
		};	
	this.calculateFirst=function(){return this.second.value();}
	this.calculateSecond=function(){return this.first.value();}		
	}